<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

 Route::get('/login/auth','Auth\AuthController@login_auth');
 Route::post('/login/store','Auth\AuthController@store');


 Route::group(['middleware' => ['auth']], function() {

   // 退出登录

  Route::get('/auth/logout', 'Auth\AuthController@getLogout');

  // 进入主页面
  
  Route::get('/','MainController@index');
  Route::get('/head','MainController@head');
  Route::get('/left','MainController@left');
  Route::get('/main','MainController@right');
  Route::get('/master','MainController@master');

  // 模块管理
  Route::group(['prefix' => '/module'],function(){

    Route::get('/index','ModuleController@index');
    Route::post('/select','ModuleController@select');
    Route::get('/create','ModuleController@create');
    Route::post('/store','ModuleController@store');
    Route::get('/del','ModuleController@del');
    Route::get('/edit/{id}','ModuleController@edit');
    Route::post('/update','ModuleController@update');

  });

  // 用户管理

  Route::group(['prefix' => '/users'],function(){

    Route::get('/index','UserController@index');
    Route::post('/select','UserController@select');
    Route::get('/create','UserController@create');
    Route::post('/store','UserController@store');
    Route::get('/del','UserController@del');
    Route::get('/edit/{id}','UserController@edit');
    Route::post('/update','UserController@update');

  });

  // 角色管理

  Route::group(['prefix' => '/roles'],function(){

    Route::get('/index','RoleController@index');
    Route::post('/select','RoleController@select');
    Route::get('/create','RoleController@create');
    Route::post('/store','RoleController@store');
    Route::get('/del','RoleController@del');
    Route::get('/edit/{id}','RoleController@edit');
    Route::post('/update','RoleController@update');

  });


});
